package com.yiduo.boot.web.controller;

import com.yiduo.boot.web.interfaces.AnnotationDemo;
import com.yiduo.boot.web.model.TestModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
@Slf4j
public class SpringbootdemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootdemoApplication.class, args);
    }

    @RequestMapping(value = "/",produces = "text/plain;charset=UTF-8")
    String index(){
        //log.error("ceshi");
        return "Hello Spring Boot!";
    }

    @RequestMapping(value = "/test",produces = "text/plain;charset=UTF-8")
    String test(@AnnotationDemo TestModel testModel){
        log.debug(testModel.getName());
        //log.error("ceshi");
        return testModel.getName();
    }
}
